package com.edu.atams.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.edu.atams.service.*;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author gfj
 * @Date 2021/10/9 1:46
 * @description
 */
public class BaseController {
    @Autowired
    HttpServletRequest req;

    @Autowired
    GradeService gradeService;

    @Autowired
    ClassService classService;

    @Autowired
    StudentService studentService;

    @Autowired
    StudentClassService studentClassService;

    @Autowired
    SysUserService sysUserService;

    @Autowired
    ParentService parentService;

    @Autowired
    StudentParentService studentParentService;

    @Autowired
    TeacherService teacherService;

    @Autowired
    SubjectService subjectService;

    @Autowired
    ClassSubjectService classSubjectService;

    @Autowired
    BCryptPasswordEncoder bCryptPasswordEncoder;


    /**
     * 获取页面
     * @return
     */
    public Page getPage() {
        int current = ServletRequestUtils.getIntParameter(req, "current", 1);
        int size = ServletRequestUtils.getIntParameter(req, "size", 10);
        return new Page(current, size);
    }
}
